from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^img/(?P<farm>\d+)/(?P<server>\d+)/(?P<id>\d+)/(?P<secret>\w+)/$', 'deduit.imgserve.views.main'),
    
    (r"^photos/friends/page(?P<page>\d+)/$", "deduit.main.views.friendsphotos"),
    (r"^photos/friends/$", "deduit.main.views.friendsphotos"),
    
    (r"^photos/(?P<nsid>\d+@\w+)/page(?P<page>\d+)/$", "deduit.main.views.userphotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/(?P<photoid>\d+)/$", "deduit.main.views.photoByID"),
    (r"^photos/(?P<nsid>\d+@\w+)/$", "deduit.main.views.userphotos"),
    (r"^photos/(?P<username>[^\/]+)/page(?P<page>\d+)/$", "deduit.main.views.usernamephotos"),
    (r"^photos/(?P<username>[^\/]+)/(?P<photoid>\d+)/$", "deduit.main.views.photoByUsernameAndID"),
    (r"^photos/(?P<username>[^\/]+)/$", "deduit.main.views.usernamephotos"),
    
    (r"^photos/(?P<username>[^\/]+)/popular-interesting/$", "deduit.main.views.popularusernamephotos"),
    (r"^photos/(?P<username>[^\/]+)/popular-interesting/page(?P<page>\d+)/$", "deduit.main.views.popularusernamephotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/popular-interesting/$", "deduit.main.views.popularuserphotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/popular-interesting/page(?P<page>\d+)/$", "deduit.main.views.popularuserphotos"),
    
    (r"^photos/(?P<username>[^\/]+)/favorites/$", "deduit.main.views.favoritesusernamephotos"),
    (r"^photos/(?P<username>[^\/]+)/favorites/page(?P<page>\d+)/$", "deduit.main.views.favoritesusernamephotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/favorites/$", "deduit.main.views.favoritesuserphotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/favorites/page(?P<page>\d+)/$", "deduit.main.views.favoritesuserphotos"),
    
    (r"^photos/(?P<nsid>\d+@\w+)/sets/$", "deduit.main.views.usersets"),
    (r"^photos/(?P<username>[^\/]+)/sets/$", "deduit.main.views.usernamesets"),
    
    (r"^photos/(?P<nsid>\d+@\w+)/sets/(?P<setid>\d+)/$", "deduit.main.views.usersetsphotos"),
    (r"^photos/(?P<username>[^\/]+)/sets/(?P<setid>\d+)/$", "deduit.main.views.usernamesetsphotos"),
    (r"^photos/(?P<nsid>\d+@\w+)/sets/(?P<setid>\d+)/page(?P<page>\d+)/$", "deduit.main.views.usersetsphotos"),
    (r"^photos/(?P<username>[^\/]+)/sets/(?P<setid>\d+)/page(?P<page>\d+)/$", "deduit.main.views.usernamesetsphotos"),
    
    (r"^groups/(?P<groupid>\d+@\w+)/pool/page(?P<page>\d+)/$", "deduit.main.views.groupphotos"),
    (r"^groups/(?P<groupid>\d+@\w+)/pool/$", "deduit.main.views.groupphotos"),
    (r"^groups/(?P<groupid>\d+@\w+)/$", "deduit.main.views.groupphotos"),
    (r"^groups/(?P<groupname>[^\/]+)/pool/page(?P<page>\d+)/$", "deduit.main.views.groupnamephotos"),
    (r"^groups/(?P<groupname>[^\/]+)/pool/$", "deduit.main.views.groupnamephotos"),
    (r"^groups/(?P<groupname>[^\/]+)/$", "deduit.main.views.groupnamephotos"),
    
    (r"^groups/(?P<groupname>[^\/]+)/popular-interesting/$", "deduit.main.views.populargroupnamephotos"),
    (r"^groups/(?P<groupname>[^\/]+)/popular-interesting/page(?P<page>\d+)/$", "deduit.main.views.populargroupnamephotos"),
    (r"^groups/(?P<groupid>\d+@\w+)/popular-interesting/$", "deduit.main.views.populargroupphotos"),
    (r"^groups/(?P<groupid>\d+@\w+)/popular-interesting/page(?P<page>\d+)/$", "deduit.main.views.populargroupphotos"),
    
    
    (r"^json/photodetails/(?P<photoid>\d+)/$", "deduit.main.json.photodetails"),    
        
    (r"^(?P<page>\d+)/$", 'deduit.main.views.main'),
	(r"^explore/interesting/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$", 'deduit.main.views.main'),
    (r"^explore/interesting/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/page(?P<page>\d+)/$", 'deduit.main.views.main'),
    
    (r"^login/", 'deduit.main.views.login'),
    (r"^auth/", 'deduit.main.views.auth'),
    (r"^comment/", 'deduit.main.views.comment'),
    (r"^fave/", 'deduit.main.views.fave'),
    (r"^test/", 'deduit.main.views.test'),
    (r"^$", 'deduit.main.views.main'),
    # Example:
    # (r'^deduit/', include('deduit.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
)
